<?php
$serverpath=$_SERVER['DOCUMENT_ROOT'];
$sectionExist=false;

$sectionName = $_POST['sectionName'];
$filename = $serverpath."/files/Section/".$sectionName.".txt";
$file = fopen($filename,"w+");
fclose($file);

$sectionFile= $serverpath."/files/sections.txt";
$arch = fopen($sectionFile,"a");
$Stringline="\r".$sectionName;
fwrite($arch,$Stringline);
header('Location: addSection.html');
?>